import React, { Component } from 'react'
import { observer } from 'mobx-react/custom'
import ComplaintRecordVM from 'cvm/record/complaintRecord'
import './complaintRecord.less'

const ComplaintRecordList = observer(({ vm }) => {
  return (
    <div className='complaint-record'>
      {/* <div className='flex-wrap common-box'>
        <div className='flex-3'>
          <p className='title'>六月使用时长-500天</p>
          <p className='tips'>北京顺达<span className='get-money'>1590.00</span>么几家家装有<span className='deduction-money'>1590.00</span>限公司</p>
        </div>
        <div className='flex-2'>
          <p className='money'>￥1480.00</p>
          <p className='time'>2108.12.12 12:26</p>
        </div>
      </div> */}
      {
        vm.complaintRecordDetail.length > 0 ? vm.complaintRecordDetail.map((item, index) => {
          return (
            <div className='flex-wrap common-box' key={index}>
              <div className='flex-3'>
                <p className='title'>{item.CompanyName}</p>
                <p className='tips'>{item.ComplaintTypeStr}-{item.ComplaintDetail}</p>
              </div>
              <div className='flex-2'>
                <p className='money'>￥{item.Deduction.toFixed(2)}</p>
                <p className='time'>{item.CreatedTimeStr}</p>
              </div>
            </div>
          )
        }) : vm.record && <div className='none-record'>
          <img src={require('../../images/none-tousu.png')} />
          <p>暂无客户投诉记录</p>
        </div>
      }
      {/* <div className='flex-wrap common-box'>
        <div className='flex-3'>
          <p className='title'>六月使用时长-500天</p>
          <p className='tips'>北京顺达么几家家装有限公司</p>
        </div>
        <div className='flex-2'>
          <p className='money'>￥1480.00</p>
          <p className='time'>2108.12.12 12:26</p>
        </div>
      </div> */}
    </div>
  )
})

@observer
class complaintRecord extends Component {
  constructor (props) {
    super(props)
    window.document.title = '客户投诉已扣除记录'
    this.vm = new ComplaintRecordVM(props)
  }
  render () {
    return (
      <div>
        <ComplaintRecordList vm={this.vm} />
      </div>
    )
  }
}

export default complaintRecord
